package com.jm.weibo.util;

import android.content.Context;
import android.view.Gravity;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.jm.weibo.ui.NewWeiboActivity;

public class MyToastUtil {
   
	public static void myToastShow(Context context, String msg){
		Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
	}
	
	public static void myToastShow(Context context){
		 Toast toast =  Toast.makeText(context , "发送中,请稍等....", 20000);
	      //设置显示位置
	      toast.setGravity(Gravity.CENTER, 0, 0);
         
	      LinearLayout toastView = (LinearLayout) toast.getView();
	      LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(20, 20);
	      toastView.setOrientation(LinearLayout.HORIZONTAL);
	      ProgressBar progressBar = new ProgressBar(context);
	      progressBar.setLayoutParams(params);
	      toastView.addView(progressBar, 0);
	      toastView.setLayoutParams(new LinearLayout.LayoutParams(20, 25));
	      toast.show();
	}
}
